<!--This Plugin was Written By Atwood Kang-->
<!--该插件由 Atwood Kang 编写-->
<!--基于 Apache-2.0-->

<!-- 
    Only open this plugin when the mode item in main.json was 1 not 0
    仅在 main.json 中 mode 为 1 而非 0 时开启
 -->

<!--
    _   _                           _   _  __                 
   / \ | |___      _____   ___   __| | | |/ /__ _ _ __   __ _ 
  / _ \| __\ \ /\ / / _ \ / _ \ / _` | | ' // _` | '_ \ / _` |
 / ___ \ |_ \ V  V / (_) | (_) | (_| | | . \ (_| | | | | (_| |
/_/   \_\__| \_/\_/ \___/ \___/ \__,_| |_|\_\__,_|_| |_|\__, |
                                                        |___/ 
-->

<?php
$setting = json_decode(file_get_contents("./././setting/main.json"),true);
$tokendata = json_decode(file_get_contents("./././userdata/token.json"),true);

if ($setting['mode'] == 0) {
    echo 'Change the mode first.';
} else {
    if(isset($_COOKIE['username'],$_COOKIE['token'])) {
        // Code Start
        for ($i = 0 ; $i <= sizeof($tokendata) -1 ; $i ++) {
            $setting[$i] = md5($setting[$i]); }
        foreach($_COOKIE as $key=>$value){
            setCookie($key,"",time()-60); }

        for ($i = 0 ; $i <= sizeof($tokendata) -1 ; $i ++) {
            $tokendata[$i] = md5($tokenddata[$i]);
            file_put_contents('http://'.$setting['domain'].'/userdata/enc.json', json_encode($$tokendata)); }
        // Code End
    } else {
        header("Location: " . $setting['jump'] . '/register.php');
    }
}
?>

<p>Change the token in token.json | Done</p>
<p>Change the cookie | Done</p>
<p>Log all user out | Done</p>
<br>
<p>Please refresh. <font color="green">Complete :)</font></p>